package com.zzyl.controller.customer;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.dto.NursingProjectPageDTO;
import com.zzyl.service.CustomerOrdersService;
import com.zzyl.vo.NursingProjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/customer/orders/project")
@Api(tags = "服务项接口")
public class CustomerOrdersController extends BaseController {

    @Autowired
    private CustomerOrdersService customerOrdersService;

    @GetMapping("page")
    @ApiOperation("分页条件查询")
    public ResponseResult pageCondition(NursingProjectPageDTO nursingProjectPageDTO){

       PageResponse<NursingProjectVo> pageResponse = customerOrdersService.pageCondition(nursingProjectPageDTO);
        return success(pageResponse);
    }

    @GetMapping("{id}")
    @ApiOperation("根据ID查询")
    public ResponseResult getById(@PathVariable Long id){
      NursingProjectVo nursingProjectVo =  customerOrdersService.getById(id);
      return  success(nursingProjectVo);
    }

}
